using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;

// The import class is a TiledData.
using TImport = TMXExtension.TiledData;

namespace TMXExtension
{
    /// <summary>
    /// Importer for the tiled class.
    /// </summary>
    [ContentImporter(".tmx", DisplayName = "Tiled Importer", DefaultProcessor = "TMXExtension.TiledProcessor")]
    class TiledImporter : ContentImporter<TImport>
    {
        /// <summary>
        /// Import the .tmx
        /// </summary>
        /// <param name="filename">Filename</param>
        /// <param name="context">Context</param>
        /// <returns>Returns the TiledData</returns>
        public override TImport Import(string filename, ContentImporterContext context)
        {
            // Read the file and return it.
            return new TiledData(System.IO.File.ReadAllText(filename));
        }
    }
}
